[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+-------+##################################################################
#+-| STR() |-----------------------------------------+########################
#| +-------+ Converts number into a formatted string |########################
#+---------------------------------------------------+########################
##############################################################################
##############################################################################
#+--| Summary |----------------+##############################################
#| #INCLUDE string.hdr |##############################################
#+-----------------------------+##############################################
##############################################################################
##############################################################################
#+--| Syntax |-----------------------------+##################################
#| FUNCTION CHAR str PROTOTYPE |##################################
#| PARAMETERS CONST DBL number, ; |##################################
#| VALUE UINT string_length, ; |##################################
#| VALUE UINT decimal_places |##################################
#+-----------------------------------------+##################################
##############################################################################
##############################################################################
########+---| Description |-------------------------------------------+#######
########| The str() function converts number into a formatted string. |#######
########| string_length is the total length of the resultant string |#######
########| including decimal places. decimal_places is the number of |#######
########| decimal digits in the string. |#######
########| ----------------------------------------------------------- |#######
########| For formatting columnar output using the ? or ?? commands, |#######
########| use the <nwidth>:<decimal places> fields. The <nwidth> |#######
########| field can be used for any type of data, e.g., DATE, INT, |#######
########| CHAR, LOGICAL, making for easy formatting of reports. |#######
########| Refer to the ?/?? command for more details. |#######
########+-------------------------------------------------------------+#######
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| |#########
#########| ? str( 10.234, 5, 2) && Prints " 10.23" |#########
#########| |#########
#########| number = 55.55 |#########
#########| ? str( number, 4, 1 ) && Prints |#########
#########| |#########
#########| *--- For numeric values, use the |#########
#########| * <nwidth>:<decimal places> field when |#########
#########| * using the ? or ?? commands. |#########
#########| |#########
#########| ? str( x, 5, 1 ) && this is identical to |#########
#########| ? x:5:1 && this... |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
i_str()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson